<%@page import="mall.bean.Category"%>
<%@page import="java.util.List"%>
<%@page import="mall.service.impl.CategoryServiceImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>表单</title>
		<link rel="stylesheet" type="text/css" href="css/scrollbar.css"/>
		<link rel="stylesheet" type="text/css" href="bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
	</head>
	<body>
		<div class="container">
			<ol class="breadcrumb">
			  <li><a href="#">首页</a></li>
			  <li><a href="#">商品模块</a></li>
			  <li class="active">添加商品类别</li>
			</ol>
			<form action="do-category-add.jsp" method="POST" class="form-horizontal">
				<div class="form-group">
					<label class="col-sm-2 control-label" for="category_name">分类名称 : </label>
					<div class="col-sm-10">
						<input class="form-control" type="text" placeholder="请输入分类名称" id="category_name" name="categoryName">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="level">级别: </label>
					<div class="col-sm-10">
						<input class="form-control" type="text" placeholder="请输入分类名称" id="level" name="level">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="parent_category">
						上级分类 :
					</label>
					<div class="col-sm-10">
						<select class="form-control" id="parent_category" name="parentId">
							<option value="0">顶级分类</option>
							<%
							CategoryServiceImpl service = new CategoryServiceImpl();
							List<Category> list = service.findAll();
							for(Category c : list)
							{
							%>
							<option value="<%=c.getCid()%>"><%=c.getName() %></option>
							<%
							}
							%>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="sort_value">
						排序值 :
					</label>
					<div class="col-sm-10">
						<input class="form-control" type="text" id="sort_value" name="sortValue">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-10">
						<button class="btn btn-primary" type="submit">提交</button>
						<button class="btn btn-warning" type="reset">重置</button>
					</div>
				</div>
			</form>
		</div>
	</body>
</html>
    